﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSTest
{
    public class Singleton
    {
        private static Singleton singleton;
        private static object _lock = new object();

        private Singleton()
        {

        }

        public static Singleton getInstance()
        {
            if (singleton == null)
            {
                lock (_lock)
                {
                    if (singleton == null)
                        singleton = new Singleton();
                }
            }
            return singleton;
        }
    }
}
